<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div class="t_bar">
	<span class="color_red">*</span>1、科技企业孵化器在孵企业一览表
</div>
<table  id="tblAttendOrg1" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead >
		<tr style="organization_finances/financeborder:1px solid #B7D1E6">
			<th class="TblHead" align="center" rowspan="2" width="3%">选择</th>
			<th class="TblHead" align="center" rowspan="2" width="3%">序号</th>
			<th class="TblHead" align="center" rowspan="2" width="10%">企业名称</th>
			<th class="TblHead" align="center" rowspan="2" width="10%">主导产品</th> 
			<th class="TblHead" align="center" rowspan="2" width="10%">技术领域</th> 
			<th class="TblHead" align="center" rowspan="2" width="10%">注册地</th>
			<th class="TblHead" align="center" rowspan="2" width="8%">注册时间</th>
			<th class="TblHead" align="center" rowspan="2" width="8%">进驻时间</th>
			<th class="TblHead" align="center" rowspan="2" width="7%">注册资金（万元）</th>
			<th class="TblHead" align="center" rowspan="2" width="7%">所占孵化场地（平方米）</th>
			<th class="TblHead" align="center" rowspan="2" width="10%">企业负责人<br/>学历</th>
			<th class="TblHead" align="center" colspan="2" width="14%">上年度</th>						
		</tr>
		<tr>
			<th class="TblHead" align="center" width="7%">营业收入(万元)</th>
			<th class="TblHead" align="center" width="7%">年末职工数(人)</th>
		</tr>
	</thead>
	<tbody id="tab">
		<tr style="display:none">
			<td align="center">
				<input type="radio" class="radiobutton" name="selAttendOrg" >
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]@seq_no" >[index]</span> 
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]|content1" label="企业名称" ></span>
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]|content2" label="主导产品" ></span>
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]|content3" label="技术领域" ></span>
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]|content4" label="注册地" ></span>
			</td>
			<td align="center" nowrap="nowrap">
				<span name="milestones|milestone5[0]|zhuce_date" label="注册时间" ></span>
			</td>
			<td align="center" nowrap="nowrap">
				<span name="milestones|milestone5[0]|jinzhu_date" label="进驻时间" ></span>
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]|content5" label="注册资金" ></span>
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]|content6" label="所占孵化场地" ></span>
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]|educate_name" label="企业负责人学历" ></span>
				<input type="hidden"name="milestones|milestone5[0]|educate_value"/>
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]|content7" label="上年度-->营业收入" ></span>
			</td>
			<td align="center">
				<span name="milestones|milestone5[0]|content8" label="上年度-->年末职工数" ></span>
			</td>
			
		</tr>
		<c:set value="0" var="index" scope="page"/>
		<x:forEach select="$xmlData/data/milestones/milestone5" var="milestone5">
		
		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr >
			<td align="center">
				<input type="radio" class="radiobutton" name="selAttendOrg" >
			</td>
			<td align="center">
				<span name="milestones/milestone5[${flag}${index}]@seq_no" ><x:out select="$milestone5/@seq_no"/></span> 
			</td>
			<td align="center">
				<span label="企业名称" name="milestones/milestone5[${flag}${index}]/content1"><x:out select="$milestone5/content1"/></span>
			</td>
			<td align="center">
				<span label="主导产品" name="milestones/milestone5[${flag}${index}]/content2"><x:out select="$milestone5/content2"/></span>
			</td>
			<td align="center">
				<span label="技术领域" name="milestones/milestone5[${flag}${index}]/content3" ><x:out select="$milestone5/content3"/></span>
			</td>
			<td align="center">
				<span label="注册地" name="milestones/milestone5[${flag}${index}]/content4" ><x:out select="$milestone5/content4"/></span>
			</td>
			<td align="center">
				<span  label="注册时间"  name="milestones/milestone5[${flag}${index}]/zhuce_date" ><x:out select="$milestone5/zhuce_date" /></span>
			</td>
			<td align="center">
				<span  label="进驻时间"  name="milestones/milestone5[${flag}${index}]/jinzhu_date" ><x:out select="$milestone5/jinzhu_date" /></span>
			</td>
			<td align="center">
				<span label="注册资金" name="milestones/milestone5[${flag}${index}]/content5" ><x:out select="$milestone5/content5"/></span>
			</td>
			<td align="center">
				<span label="所占孵化场地" name="milestones/milestone5[${flag}${index}]/content6" ><x:out select="$milestone5/content6"/></span>
			</td>
			<td align="center">
				<span label="企业负责人学历" name="milestones/milestone5[${flag}${index}]/educate_name" ><x:out select="$milestone5/educate_name"/></span>
				<input type="hidden" name="milestones/milestone5[${flag}${index}]/educate_value" value="<x:out select="$milestone5/educate_value" />" /> 
			</td>
			<td align="center">
				<span label="上年度-->营业收入" name="milestones/milestone5[${flag}${index}]/content7" ><x:out select="$milestone5/content7"/></span>
			</td>
			<td align="center">
				<span label="上年度-->年末职工数" name="milestones/milestone5[${flag}${index}]/content8" ><x:out select="$milestone5/content8"/></span>
			</td>
			
		</tr>

		<c:set value="${index+1}" var="index" scope="page"/>
		</x:forEach>
	</tbody>
	<tr>

</table>
<br/>

	<table width="98%" align="center"  border="0" cellpadding="0" cellspacing="1">
					<tr >
					<input class="button" type="button" name="cmdAddbefore" value="添加" onclick="if(checkTabLimit('tblAttendOrg1',99,'科技企业孵化器在孵企业一览表最多只能填写99条')){addNewRow('tblAttendOrg1','${ctx}/proposal/edit/dialog/orgInfoEdit_fhqrd1?parentTab=tblAttendOrg1&type=add&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','科技企业孵化器在孵企业一览表');}try{top.resizeFrame();}catch(e){};">
				&nbsp;<input class="button"   name="cmdMovePrev" type="button" value="上移" onclick="movePrev2('tblAttendOrg1');">
				&nbsp;<input class="button"   name="cmdMoveNext"  type="button" value="下移" onclick="moveNext2('tblAttendOrg1');">
				&nbsp;<input class="button"  id="cmdEdit" type="button" value="编辑" onclick="editRow('tblAttendOrg1','${ctx}/proposal/edit/dialog/orgInfoEdit_fhqrd1?parentTab=tblAttendOrg1&type=edit&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','科技企业孵化器在孵企业一览表')">
				&nbsp;<input class="button"  name="cmddel" type="button" value="删除" onclick="deleteSelectedRow2('tblAttendOrg1','科技企业孵化器在孵企业一览表');"></td>
	</tr>
	</table>



	<br/>
<script type="text/javascript">
$(function() {
	$("#tblMileStones tr:even").addClass("li_1");
	$("#tblMileStones tr:odd").addClass("li_2");
});
$(function() {
	$("#tblMileStones1 tr:even").addClass("li_1");
	$("#tblMileStones1 tr:odd").addClass("li_2");
});

/**
 * 删除一行
 * @param radioId 
 */
function deleteSelectedRow2(tableId,message,nummin,warnMsg,selName){
	if(!selName)selName="";
	var tr=$("#"+tableId+" :radio[name*='"+selName+"']:checked").parents("tr");
	if(nummin==null)
		nummin=0;
	var length=tr.length;
	if(tr.length==0)
		tr=$("#"+tableId+" tr").filter(":last");
	else if(tr.length>1)
		tr=tr.first();

	if(tr.get(0).rowIndex-1==nummin){
		scmWarn(irisNotes.delWarn1);
		return false;
	}
	if(length==0){
		
			scmWarn(irisNotes.delWarn2);
		
		return false;
	}
	  if(!confirm(messageTip.deleteTip+message+"？"))
		  return false;
	  tr.remove();
	  refreshRowINdex2(tableId);
	  return true;
}

/**
 * 上移行
 * @param tblId
 * @returns {Boolean}
 */
function movePrev2(tblId,selName) {

	if (!selName)
		selName = "";
	if ($("#" + tblId + " :radio[name*='" + selName + "']:checked").length == 0) {
		scmWarn(irisNotes.prevWarn);
		return false;
	}
	if ($("#" + tblId + " tr").length <= 3)
		return false;
	var trChecked = $("#" + tblId + " :radio[name*='" + selName + "']:checked")
			.parents("tr").first();// 取得被选中的行
	var trPrev = trChecked.prev();// 取得上一行
	var index = trChecked.get(0).rowIndex;// 获得行号
	if (index <= 3) {// 如果是第一行
		scmWarn(irisNotes.tabelMoveWarn1);
		return false;
	}
	//trChecked.remove();
	trPrev.before(trChecked);
	trChecked.find(":radio[name*='" + selName + "']").attr("checked", 'true');
	refreshRowINdex2(tblId);
}

/**
 * 下移行
 * @param tblId
 * @returns {Boolean}
 */
function moveNext2(tblId,selName) {
	if (!selName)
		selName = "";
	if ($("#" + tblId + " :radio[name*='" + selName + "']:checked").length == 0) {
		scmWarn(irisNotes.nextWarn);
		return false;
	}
	if ($("#" + tblId + " tr").length <= 3) {
		return false;
	}
	var trChecked = $("#" + tblId + " :radio[name*='" + selName + "']:checked")
			.parents("tr").first();// 取得被选中的行
	var trNext = trChecked.next();
	var index = trChecked.get(0).rowIndex;// 获得行号
	if (index == $("#" + tblId + " tr").length - 2) {// 如果是第一行
		scmWarn(irisNotes.tabelMoveWarn2);
		return false;
	}
	//trChecked.remove();
	trNext.after(trChecked);
	trChecked.find(":radio[name*='" + selName + "']").attr("checked", "true");
	refreshRowINdex2(tblId);
}

/**
 * 重新计算行号
 * @param tblId
 */
function refreshRowINdex2(tblId){
	 //重新计算行号

	
	  $("#"+tblId+" tr").each(function(){
		  
		   var seq=$(this).get(0).rowIndex;//获得行数
		   if(seq>2){//如果有行  显示时display行不计入类，故减2
			   
			   seq=seq-2;
			   var seq_no=$(this).find("[name$='seq_no']");
			   if(seq_no.is("span"))
				   seq_no.html(seq);
			   else
				   seq_no.val(seq);
			   
			   seq=""+(seq-1);
			   if(seq.length==1)
				   seq="0"+seq;
			  //替换相应的name参数的seq
			  $(this).find("input,span,textarea,select").each(function(){
				   var name=$(this).attr("name");
				   if(name!=null&&name!=""){
					   name=name.replace(/\[\d*\]/g,"["+seq+"]");
					   $(this).attr("name",name);
				   }
				   var id=$(this).attr("id");
				   if(id!=null&&id!=""){
					   id=id.replace(/\[\d*\]/g,"["+seq+"]");
					   $(this).attr("id",id);
					   id=id.replace(/\d+/g,""+seq+"");
					   $(this).attr("id",id);
				   }
				   var className=$(this).attr("class");
				   if(className!=null&&className!=""){
					   className=className.replace(/\[\d*\]/g,"["+seq+"]");
					   $(this).attr("class",className);
				   }
			   });
		   }
		 }
	  );

}


</script>